/**
 * @(#) A.java
 */

package Q5;

import java.util.Collection;

public class A
{
	private Collection <B> collB;
	
	public void Add (B b){
		collB.add(b);
		b.AddFromB(this);
	}
	protected void AddFromA (B b){
		collB.add(b);
	}
	public void Remove (B b){
		if (collB.contains(b))
		{
			collB.remove(b);
		}
		b.RemoveFromB(this);
	}
	
	protected void RemoveFromA (B b){
		if (collB.contains(b))
		{
			collB.remove(b);
		}
	}
}
